From 4e1cf7ae5f8cc7d59f3b5433d3b34a349687d01d Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 21 Oct 2005 14:33:46 +0100 Subject: [PATCH] Fix early bootstrap of secondary VCPUs on x86/64. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c index a0ec7cff1f..f1f733df5a 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c @@ -179,6 +179,8 @@ void vcpu_prepare(int vcpu) ctxt.syscall_callback_eip = (unsigned long)system_call; ctxt.ctrlreg[3] = virt_to_mfn(init_level4_pgt) << PAGE_SHIFT; + + ctxt.gs_base_kernel = (unsigned long)(cpu_pda + vcpu); #endif BUG_ON(HYPERVISOR_vcpu_op(VCPUOP_initialise, vcpu, &ctxt)); @@ -208,6 +210,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus) if (IS_ERR(idle)) panic("failed fork for CPU %d", cpu); +#ifdef __x86_64__ + cpu_pda[cpu].pcurrent = idle; + cpu_pda[cpu].cpunumber = cpu; + per_cpu(init_tss,cpu).rsp0 = idle->thread.rsp; + clear_ti_thread_flag(idle->thread_info, TIF_FORK); +#endif + irq_ctx_init(cpu); cpu_gdt_descr[cpu].address = -- 2.30.2